import request from '@/utils/request'

const prefix = "/api/login"


/** 
 * 登录
 */
function auth(data) {
	return request({
		url: prefix + '/auth',
		method: 'post',
		data
	})
}


/** 
 * 获取用户信息
 */
function userInfo() {
	return request({
		url: prefix + '/userInfo',
		method: 'get',
	})
}

/**
 * 修改资料
 * @param {Object} data
 */
function EditUser(data) {
	return request({
		url: prefix + '/editUser',
		method: 'put',
		data: data
	})
}


/**
 * 退出登录
 */
function logout() {
	return request({
		url: '/logout',
		method: 'post'
	})
}

export default {
	auth,
	userInfo,
	logout,
	EditUser
}